home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mintmant / pwait.txt < prev    next >
Text File  |  1992-03-24  |  3KB  |  130 lines

  1. Pwait3(2)                 Oct. 1, 1991                  Pwait3(2)
  2.  
  3.  
  4.  
  5. NAME
  6.      Pwait, Pwait3 - get exit status of children
  7.  
  8. SYNOPSIS
  9.      LONG Pwait();
  10.      LONG Pwait3( WORD flag, LONG *rusage );
  11.  
  12. DESCRIPTION
  13.      Pwait3 attempts to determine the exit code for  any  stopped
  14.      children  or children that have terminated. If bit 1 of flag
  15.      is set, then children that are stopped due  to  job  control
  16.      are  reported;  otherwise  only  children that have actually
  17.      terminated are reported. A stopped process will be  reported
  18.      at  most  once  (unless it is re-started and stopped again);
  19.      similarly a terminated process will be reported only once.
  20.  
  21.      If the process does have children, but  none  are  currently
  22.      stopped  or  terminated  and  not  yet  waited for, then the
  23.      behavior of Pwait3 is controlled by bit 0 of flag.  If it is
  24.      clear, the function will wait until some child is stopped or
  25.      terminates; if it is set, the function will  return  immedi-
  26.      ately.
  27.  
  28.      The rusage parameter, if non-zero, should point to two  long
  29.      words,  into  which  information  about the child's CPU time
  30.      usage is placed, as follows:
  31.      rusage[0]: milliseconds spent by child in user space
  32.      rusage[1]: milliseconds spent by child in kernel space
  33.  
  34.      The Pwait() system call is  equivalent  to  Pwait3(2,  (LONG
  35.      *)0),  and is provided both for convenience and for backward
  36.      compatibility.
  37.  
  38. RETURNS
  39.      If a child process is found, its process id is placed in the
  40.      upper  16  bits  of  the 32 bit value returned, and its exit
  41.      status (as passed to Pterm or Ptermres, as determined impli-
  42.      citly by Pterm0, or as determined by the type of signal that
  43.      stopped or killed the process) is placed  in  the  lower  16
  44.      bits.  If the process was stopped or terminated by signal n,
  45.      then its exit status will be ( n<< 8 ) | x.  where x is  127
  46.      if  the  process  was  stopped and 0 if the process was ter-
  47.      minated.
  48.  
  49.      0 if bit 0 of flag is set and the Pwait3 system  call  would
  50.      have otherwise blocked waiting for a child to exit or stop.
  51.  
  52.      EFILNF if no unwaited for children exist
  53.  
  54. SEE ALSO
  55.      Pexec(2), Pterm(2), Pterm0(2), Ptermres(2)
  56.  
  57.  
  58.  
  59.  
  60. Version 0.9   Last change: MiNT Programmer's Manual             1
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67. Pwait3(2)                 Oct. 1, 1991                  Pwait3(2)
  68.  
  69.  
  70.  
  71. BUGS
  72.      It is not possible to wait for a specific child process.
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126. Version 0.9   Last change: MiNT Programmer's Manual             2
  127.  
  128.  
  129.  
  130.